﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using FitAutomation;
using MyUtils;

namespace FitAutomation_UnitTest_Exe
{
	public static class FitAutomation_UnitTest_ExeProgram
	{
		
	}

	static class Program
	{
		static void Main(string[] args)
		{
			DebugUtils.DebuggerReattaching();

			foreach (var s in args)
			{
				var mi = typeof (Program).GetMethod(s, System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
				mi.Invoke(null, null);
			}

			WaitForMx();
		}

		static void Register()
		{
			FitAutomationFacade.RegisterProcess();
		}

		static void RegisterById()
		{
			FitAutomationFacade.RegisterProcess(new Guid("EAFEA7DD-2D2C-4020-9422-9EAFD1E860D5"));
		}

		static void RegisterByString()
		{
			FitAutomationFacade.RegisterProcess("HAHA-EAFEA7DD-2D2C-4020-9422-9EAFD1E860D5");
		}

		static void Sleep3()
		{
			Thread.Sleep(3000);
		}

		static void SleepForever()
		{
			Thread.Sleep(Timeout.Infinite);
		}

		static void WaitForMx()
		{
			new Mutex(false, "FitAutomation_UnitTest_ExeProgram_WaitForMx").WaitOne();
		}
	}
}
